package com.cookor.poi.modules.phy.mobile;

import com.cookor.poi.modules.phy.dao.TPatientDao;
import com.cookor.poi.modules.phy.entity.TPatient;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
@RequestMapping({"test"})
public class TestFileController {
  @Autowired
  private TPatientDao tPatientDao;
  
  @RequestMapping({"111"})
  public String test() {
    List<TPatient> test = this.tPatientDao.test();
    int n = 1;
    for (TPatient tPatient : test) {
      TPatient bean = new TPatient();
      bean.setOpenId(tPatient.getOpenId());
      bean.setCard(tPatient.getCard());
      bean.setMobile(tPatient.getMobile());
      List<TPatient> list = this.tPatientDao.findList(bean);
      for (int i = 0; i < list.size() - 1; i++) {
        this.tPatientDao.myDele(((TPatient)list.get(i)).getId());
        System.out.println(n++);
      } 
    } 
    return "xYpK1wrr12w79ZPE";
  }
}
